#!/bin/sh
PATH=$PATH:/sbin:/bin:/usr/bin:/usr/sbin
echo -n Try to bring eth0 interface up......>/dev/ttySAC0

if [ -f /etc/eth0-setting ] ; then
	source /etc/eth0-setting

	if grep -q "^/dev/root / nfs " /etc/mtab ; then
		echo -n NFS root ... > /dev/ttySAC0
	else
		ifconfig eth0 down
		ifconfig eth0 hw ether $MAC
		ifconfig eth0 $IP netmask $Mask up
		route add default gw $Gateway
	fi

	echo nameserver $DNS > /etc/resolv.conf
else

	if grep -q "^/dev/root / nfs " /etc/mtab ; then
		echo -n NFS root ... > /dev/ttySAC0
	else
	/sbin/ifconfig eth0 192.168.1.6 netmask 255.255.255.0 up
	fi
fi

echo Done > /dev/ttySAC0
